<?php
/**
* smarty function to get constant value which define before
* @param  name    the constant name
* @param  assign  the assign to variable name
* @return string of value or assign to value if assign param is set
*/
function smarty_function_innoforum_subcategory($params, &$smarty) 
{
    //Get value from page
    $subcategory_id = $params['subcategory_id'];
    if($subcategory_id){
      //Query data
      $sql = "SELECT
                scy_name  
              FROM
                zk_innoforum_subcategory
              WHERE
                scy_id = ".$subcategory_id;

      $column = array("scy_name");
      $result = DBUtil::executeSQL($sql);
      $objectArray = DBUtil::marshallObjects ($result, $column);
      $subcategory = $objectArray['0']['scy_name'];
     
    }
    if ($subcategory) {
        echo $subcategory; 
    } else {
        echo "";
    }
}